<script lang="ts">
export default {
  name: 'kaoshi2'
}
</script>

<script lang="ts" setup>
import { reactive } from 'vue'

interface Iuser {
  name?: string | null
  age?: number | null
}

const user = reactive<Iuser>({
  name: null,
  age: null
})
</script>
<template>
  <div>
    <div class="form-container">
      <h2>Enter your information</h2>
      <label for="name">Name:{{ user.name }}</label>
      <input id="name" v-model="user.name" type="text" />

      <label for="age">Age:{{ user.age }}</label>
      <input id="age" v-model="user.age" type="number" />

      <p>Your name is {{ user.name }} and you are {{ user.age }} years old.</p>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.form-container {
  margin: 20px;
}

input {
  display: block;
  margin: 10px 0;
  padding: 5px;
}

label {
  font-weight: bold;
}

p {
  margin-top: 20px;
  font-size: 1.2em;
}
</style>
